extends ActionLeaf

@export var c_sharp_script_path = "";
#var c_sharp_script = load("res://script/Behave/EnemyRoud.cs")
#var c_sharp_node = c_sharp_script.new()
var c_sharp_node;

@export var subNodeNum: int = 0;
@export var animation:String = "";
func _ready():
	if c_sharp_script_path != "":
		c_sharp_node = load(c_sharp_script_path).new();
		c_sharp_node.SetAnimeName(animation);
		c_sharp_node.SetNodeNo(subNodeNum);
		
		

func tick(_actor: Node, _blackboard: Blackboard) -> int:
	if c_sharp_node != null:
		return c_sharp_node.tick(_actor, _blackboard);
	return FAILURE;
	
func interrupt(_actor: Node, _blackboard: Blackboard) -> void:
	if c_sharp_node != null:
		c_sharp_node.interrupt(_actor);

func before_run(_actor: Node, _blackboard: Blackboard) -> void:
	if c_sharp_node != null:
		c_sharp_node.beforeRun(_actor);

func after_run(_actor: Node, _blackboard: Blackboard) -> void:
	if c_sharp_node != null:
		c_sharp_node.afterRun(_actor);
